/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: DcmDsl.c
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: DCMDSL
*
* Revision:
* --------------------------------------------------------------------------------
* v0.1: 
* --Yueting.Ben, 2024-03-11 
* --Initial release

**********************************************************************************/

/** HEADER FILES **/
#include "DcmDslCfg.h"
#include "PduRDcmCfg.h"


/** MACRO DEFINITION **/


/** TYPEDEF DEFINITION **/


/** LOCAL DATA DECLARATION **/
Dcm_MsgItemType Dcm_DslBuffer[DCM_DSL_PROTOCAL_MAX_RES_SIZE];
Dcm_MsgItemType Dcm_DslDiagResp[DCM_DSL_RES_PEND_MAX_RES_SIZE];
DcmDslProtocolType DcmDslProtocolCfg;


/** LOCAL DATA **/
Dcm_MsgItemType Dcm_DslBuffer[DCM_DSL_PROTOCAL_MAX_RES_SIZE] = {0x00u};
Dcm_MsgItemType Dcm_DslDiagResp[DCM_DSL_RES_PEND_MAX_RES_SIZE] = {0x00u};


DcmDslProtocolType DcmDslProtocolCfg = 
{
    {
        /* protocolRow: for reception of UDS functionally addressed requests */
        {
            {
                {
                    DcmConf_DcmRxPduCfg_Pdu_DiagFuncRequest, /* DcmDslProtocolRxConnectionId */
                    NULL_PTR, /* DcmDslProtocolComMChannelRef */
                    {
                        NULL_PTR, /* DcmDslProtocolTxPduRef */
                        DcmConf_DcmTxPduCfg_Pdu_DiagResponse /* DcmDslTxConfirmationPduId */ 
                    },/* DcmDslProtocolTx */
                    {
                        NULL_PTR, /* DcmDslProtocolRxPduRef */
                        DcmConf_DcmRxPduCfg_Pdu_DiagFuncRequest, /* DcmDslProtocolRxPduId */
                        DCM_FUNCTIONAL_TYPE /* DcmDslProtocolRxAddrType */
                    }/* DcmDslProtocolRx */
                },/* DcmDslMainConnection  */
                {
                    0x00 /* DcmDslPeriodicTxConfirmationPduId */
                }/* DcmDslPeriodicTransmission */
            },/* DcmDslConnection */
            (Dcm_SvcCfgType*)Dcm_SvcFuncCfg, /* DcmDsdServiceTable */
            Dcm_DslBuffer, /* DcmDslProtocolRxBufferRef */
            Dcm_DslBuffer, /* DcmDslProtocolTxBufferRef */
            0x00, /* DcmDspProtocolEcuAddr */
            DCM_DSL_PROTOCAL_MAX_RES_SIZE, /* DcmDslProtocolMaximumResponseSize     */
            
            50u, /* P2:50ms DcmTimStrP2ServerAdjust */
            5000u, /* P2*:5000ms DcmTimStrP2StarServerAdjust */

            RESET, /*   DcmSendRespPendOnRestart */
        },
        /* protocolRow: for reception of UDS physically addressed requests */
        {
            {
                {
                    DcmConf_DcmRxPduCfg_Pdu_DiagPhyRequest, /* DcmDslProtocolRxConnectionId */
                    NULL_PTR, /* DcmDslProtocolComMChannelRef */
                    {
                        NULL_PTR, /* DcmDslProtocolTxPduRef */
                        DcmConf_DcmTxPduCfg_Pdu_DiagResponse /* DcmDslTxConfirmationPduId */ 
                    },/* DcmDslProtocolTx */
                    {
                        NULL_PTR, /* DcmDslProtocolRxPduRef */
                        DcmConf_DcmRxPduCfg_Pdu_DiagPhyRequest, /* DcmDslProtocolRxPduId */
                        DCM_PHYSICAL_TYPE /* DcmDslProtocolRxAddrType */
                    }/* DcmDslProtocolRx */
                },/* DcmDslMainConnection  */
                {
                    0x00 /* DcmDslPeriodicTxConfirmationPduId */
                }/* DcmDslPeriodicTransmission   */
            },/* DcmDslConnection */
            (Dcm_SvcCfgType*)Dcm_SvcCfg, /* DcmDsdServiceTable */
            Dcm_DslBuffer, /* DcmDslProtocolRxBufferRef */
            Dcm_DslBuffer, /* DcmDslProtocolTxBufferRef */
            0x00, /* DcmDspProtocolEcuAddr */
            DCM_DSL_PROTOCAL_MAX_RES_SIZE, /* DcmDslProtocolMaximumResponseSize     */
        
            50u, /* P2:50ms DcmTimStrP2ServerAdjust */
            5000u, /* P2*:5000ms DcmTimStrP2StarServerAdjust */
        
            RESET, /*   DcmSendRespPendOnRestart */
        }
    }
};




